<%= render :partial => '/organizations/menu' %>
<td class = "content_area">
	<h2><hr>Activities for A.Y. <%=h Time.now.year %> - <%=h Time.now.year+1 %><hr></h2>
	<div id = "notification"><%=h flash[:notice] %></div>
	<div id = "error"><%=h flash[:error] %></div>
	<%= error_messages_for 'event' %>
	<table>
	<% if  @editable %>
	<th class = "buttons_table"><%= button_to 'Add Event', :controller => 'events', :action => 'new' %></th>
	<% end %>
	<th class = "buttons_table"><%= button_to 'Back to Forms', :controller => 'organizations', :action => 'show_forms' %></th>
	</table>
	<% for c in ["Academic Activities", "Advocacy and Extension Service", "UP Community Service", "Organization - Capacity Building Activities"]%>
		<h3><%= c %></h3>
		<div class = "content">
		<% if @events.find_by_category(c) %>
			<table class = "form_table" border = 1>
				<tr>
					<th width = "20%">Name</th>
					<th width = "15%">Date</th>
					<th width = "15%">Venue</th>
					<th width = "35%">Description</th>
					<th width = "25%">Person in-charge</th>
				</tr>
			<% for event in @events.all(:conditions => "category = '#{c}'", :order => "name ASC") %>
				<tr>
					<td><%=h event.name %><br>
					<% if  @editable %>
						<font size=1><%= link_to 'delete', {:controller => 'events', :action => 'destroy', :id => event.id}, :confirm => "Are you sure you want to delete this event?"  %></font></td>
					<% end %>
					<td><%=h event.date %></td>
					<td><%=h event.venue %></td>
					<td><%=h event.description %></td>
					<td><%= event.head %></td>
				</tr>
			<% end %>
			</table>
		<% end %>
		</div>
	<% end %>
</td>